package com.sdry.product.common.controller;

import com.alibaba.fastjson.JSONObject;
import com.sdry.common.BaseController;
import com.sdry.common.TableDataInfo;
import com.sdry.product.common.entity.ProductInverted;
import com.sdry.product.common.service.ProductInvertedService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;

/**
 * (倒框或者倒架)表控制层
 *
 * @author makejava
 * @since 2020-03-13 15:39:29
 */
@Controller
@RequestMapping("productInverted")
public class ProductInvertedController extends BaseController {
    /*** 服务对象*/
    @Resource
    private ProductInvertedService productInvertedService;

    @RequestMapping(value = "showProductInverted")
    public String showProductInverted() {
      return "/product/prod/inverted";
    }

    /**
     * 分页查询倒架或者倒框操作
     * @param productInverted
     * @return
     */
    @RequestMapping(value = "queryProductInvertedPage")
    @ResponseBody
    public TableDataInfo queryProductInvertedPage(ProductInverted productInverted) {
        logger.info("分页查询倒架或者倒框操作", JSONObject.toJSONString(productInverted));
        List<ProductInverted> productInvertedList =productInvertedService.queryProductInvertedPage(productInverted);
        Long total =productInvertedService.queryProductInvertedTotal(productInverted);
        return getDataTable(productInvertedList,total);
    }

    /**
     * 添加
     * @return boolean
     */
    @RequestMapping()
    public boolean add() {

        return false;
    }
}